import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class DateIdentity {

    /**
     * 提示用户输入年月日，判断该天是当年的第多少天
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = scanner.nextInt();

        System.out.println("请输入月份");
        int month = scanner.nextInt();

        System.out.println("请输入日期");
        int day = scanner.nextInt();

        int result = dayOfTheYear(year, month, day);
        String content = year + "年" + month + "月" + day + "日" + "是这一年的第" + result + "天";
        System.out.println(content);

        scanner.close();
    }

    public static int dayOfTheYear(int year, int month, int day) {

        Calendar calendar = Calendar.getInstance();
        calendar.set(year, month-1, day);
        return calendar.get(Calendar.DAY_OF_YEAR);
    }
}
